(function(){"use strict";BX.namespace("BX.Landing.Provider.Map");var n=BX.Landing.Utils.isFunction;var e=BX.Landing.Utils.isPlainObject;var t=BX.Landing.Utils.create;function i(n){if(!e(n)){var t=a();return{center:t,zoom:17,markers:[{latLng:t,title:"Bitrix24",description:"Bitrix24 - Your company. United."}]}}return n}function a(){var n={lat:0,lng:0};switch(BX.Landing.Loc.getMessage("LANGUAGE_ID")){case"ru":n={lat:54.71916849999999,lng:20.48854240000003};break;case"ua":n={lat:50.440333,lng:30.526835};break;default:n={lat:38.814089,lng:-77.042356};break}return n}BX.Landing.Provider.Map.BaseProvider=function(e){this.onChangeHandler=n(e.onChange)?e.onChange:function(){};this.onMapClickHandler=n(e.onMapClick)?e.onMapClick:function(){};this.onAddMarkerHandler=n(e.onAddMarker)?e.onAddMarker:function(){};this.options=e;this.mapContainer=e.mapContainer;this.mapOptions=i(e.mapOptions);this.markers=new BX.Landing.Collection.BaseCollection;this.mapInstance=null;this.init()};BX.Landing.Provider.Map.BaseProvider.prototype={init:function(){throw new Error("Must be implemented by subclass")},addMarker:function(n){throw new Error("Must be implemented by subclass")},removeMarker:function(n){throw new Error("Must be implemented by subclass")},getValue:function(){throw new Error("Must be implemented by subclass")},onEditFormApplyClick:function(){throw new Error("Must be implemented by subclass")},onEditFormRemoveClick:function(n){throw new Error("Must be implemented by subclass")},createBalloonEditForm:function(n,e){var i=new BX.Landing.UI.Form.BalloonForm({title:BX.Landing.Loc.getMessage("LANDING_NODE_MAP_FORM_HEADER")});var a=new BX.Landing.UI.Button.BaseButton({text:BX.Landing.Loc.getMessage("LANDING_NODE_MAP_FORM_SHOW_BUTTON_APPLY"),className:["ui-btn","ui-btn-success","ui-btn-sm"],onClick:this.onEditFormApplyClick.bind(this,e)});var o=new BX.Landing.UI.Button.BaseButton({text:BX.Landing.Loc.getMessage("LANDING_NODE_MAP_FORM_SHOW_BUTTON_REMOVE"),className:["ui-btn","ui-btn-danger","ui-btn-sm"],onClick:this.onEditFormRemoveClick.bind(this,e)});a.layout.classList.remove("landing-ui-button");o.layout.classList.remove("landing-ui-button");var r=t("div",{props:{className:"ui-btn-container ui-btn-container-center"},children:[a.layout,o.layout]});i.addField(new BX.Landing.UI.Field.Text({title:BX.Landing.Loc.getMessage("LANDING_NODE_MAP_FORM_TITLE"),textOnly:true,content:n.title}));i.addField(new BX.Landing.UI.Field.Text({title:BX.Landing.Loc.getMessage("LANDING_NODE_MAP_FORM_DESCRIPTION"),className:"landing-ui-field-map-description",content:n.description}));i.addField(new BX.Landing.UI.Field.Checkbox({className:"landing-ui-field-map-show-by-default",compact:true,items:[{name:BX.Landing.Loc.getMessage("LANDING_NODE_MAP_FORM_SHOW_BY_DEFAULT"),value:true}],value:[n.showByDefault]}));i.layout.appendChild(r);return i},createBalloonContent:function(n){return t("div",{props:{className:"landing-map-balloon-content"},children:[t("div",{props:{className:"landing-map-balloon-content-header"},html:n.title}),t("div",{props:{className:"landing-map-balloon-content-description"},html:n.description})]})}}})();
//# sourceMappingURL=base-map-provider.map.js